package com.teamin.entity;

import com.teamin.web.Evn;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 圈子中用户的实体类
 */
public class CircleUserEntity extends UserEntity implements Serializable {

    @ApiModelProperty(value = "用户昵称")
    @Length(min = 1,max = 16, message = "昵称的长度不能大于16")
    protected String nickName;

    @ApiModelProperty(value = "用户手机号")
    @Pattern(regexp=Evn.PATTERN_MOBILE,message = "手机号的格式不对")
    protected String circlePhone;

    @ApiModelProperty(value = "用户邮箱")
    @Pattern(regexp= Evn.PATTERN_EMAIL,message = "邮箱的格式不对")
    protected String circleEmail;

    @ApiModelProperty(value = "用户职位")
    @Length(min = 0,max = 32, message = "职位的长度不能大于32")
    protected String circleJob;

    @ApiModelProperty(value = "是否是圈子的管理员")
    private boolean isCreater;

    public String getCirclePhone() {
        return circlePhone;
    }

    public String getCircleEmail() {
        return circleEmail;
    }

    public String getCircleJob() {
        return circleJob;
    }

    public void setCirclePhone(String circlePhone) {
        this.circlePhone = circlePhone;
    }

    public void setCircleEmail(String circleEmail) {
        this.circleEmail = circleEmail;
    }

    public void setCircleJob(String circleJob) {
        this.circleJob = circleJob;
    }

    public CircleUserEntity(Long userId, String userName, String headIcon) {
        this.userId = userId;
        this.userName = userName;
        this.headIcon = headIcon;
    }

    public CircleUserEntity() {
    }
    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public boolean isCreater() {
        return isCreater;
    }

    public void setCreater(boolean creater) {
        isCreater = creater;
    }

    @Override
    public String toString() {
        return "CircleUserEntity{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", headIcon='" + headIcon + '\'' +
                ", isCreater=" + isCreater +
                '}';
    }
}